//
//  FQDInputSettingCell.m
//  FakeQDaily
//
//  Created by mewxiv on 9/11/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDInputSettingCell.h"

@interface FQDInputSettingCell ()

@property (nonatomic, strong) UIVisualEffectView *effectBgView;

@end

@implementation FQDInputSettingCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    self.backgroundColor = [UIColor clearColor];
    
    UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    _effectBgView = [[UIVisualEffectView alloc] initWithEffect:effect];
    _effectBgView.frame = self.bounds;
    [self addSubview:_effectBgView];
    [self sendSubviewToBack:_effectBgView];
   
    CGSize cellSize = self.bounds.size;
    CGRect textFieldFrame = CGRectMake(15.0f, 0, cellSize.width - 30.0f, cellSize.height);
    _textField = [[UITextField alloc] init];
    _textField.font = FQDRegularFontWithSize(14.0f);
    _textField.textColor = [UIColor whiteColor];
    _textField.tintColor = FQDHighlightColor;
    _textField.frame = textFieldFrame;
    [self.contentView addSubview:_textField];
}

+ (NSString *)reuseId
{
    return @"FQDInputSettingCell";
}
@end
